home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1361 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: rover.ucs.ualberta.ca!alberta!usenet
  2. From: Ryan Gallagher <ryangall@gpu.srv.ualberta.ca>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: The dreaded screen flicker (To graphics programmers)
  5. Date: 13 Jan 1996 00:56:59 GMT
  6. Organization: Computing Science, U of Alberta, Edmonton, Canada
  7. Message-ID: <4d700r$nva@scapa.cs.ualberta.ca>
  8. References: <DKzBFJ.BC6@eskimo.com>
  9. NNTP-Posting-Host: assn217.cs.ualberta.ca
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.4 sun4c)
  14. X-URL: news:DKzBFJ.BC6@eskimo.com
  15.  
  16. This is definitely not the best solution, but if you are looking for quick
  17. results, I just finished writing a 3-d object building, and motion program, and
  18. found that creating a tiny queue for the objects worked quite well for motion.
  19. It doesnt eliminate 100% of the flicker, but it at least waits till the new
  20. object is drawn at its new location before erasing the previous one. 
  21.  
  22.  Just set a maximum length for the queue...usually 2 (for my stuff) make sure
  23. you have a int CountQueue(Q) procedure, and Enqueue the new location of the
  24. object. If CountQueue(Q) exceeds the maximum length, erase the object at the
  25. the end of the queue and Dequeue(Q); this works pretty good, and you can use it
  26. for so many other cool things (even though its a pretty cheesie way of doing
  27. it, it works good enough as far as Im concerned), if you are interested, you
  28. cancheck for line intersections, and make sure that when you erase at the last
  29. location in the queue you aren't deleting from the current position. Thats
  30. pretty easy too, but a bit slower.  
  31.  
  32. anyways....later!
  33.  
  34.